import * as React from 'react';
import  {Route, Switch} from 'react-router-dom';
import Home from './Home'
import Mine from './Mine'
import Profile from './Profile'
import Detail from './Detail'
import Login from './Login'
import Reg from './Reg'
import Tab from '../components/Tab'
import PrivateRoute from './PrivateRoute'
import '../common/index.less'
class App  extends React.Component {
  render() { 
    return ( 
      <React.Fragment>
        <Switch>
          <Route exact path="/" component={Home}></Route>
          {/* <Route exact path="/mine" component={Mine}></Route> */}
          <Route exact path="/profile" component={Profile}></Route>
          <Route exact path="/detail/:id" component={Detail}></Route>
          <Route exact path="/login" component={Login}></Route>
          <Route exact path="/reg" component={Reg}></Route>
          {/* 受保护的路由 */}
          {/* 通过dom-diff修改不渲染问题 */}
          <PrivateRoute  path="/mine" component={Mine}></PrivateRoute>
        </Switch>
          
      
      
        <Tab/>
      </React.Fragment>
    )
  }
}
 
export default App